package com.woniu.microcommunityserver.tribal.controller;

import com.woniu.microcommunityserver.res.ResponseMsg;
import com.woniu.microcommunityserver.tribal.entity.TribalCategoryInfoEntity;
import com.woniu.microcommunityserver.tribal.mapper.TribalCategoryInfoMapper;
import com.woniu.microcommunityserver.tribal.service.TribalCategoryInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("tribal")
public class TribalCategoryInfoController {
    @Resource
    private TribalCategoryInfoService tribalCategoryInfoService;

    @GetMapping("findCategory")
    public ResponseMsg findTribalCategory(){
        List<TribalCategoryInfoEntity> tribalCategory = tribalCategoryInfoService.findTribalCategory();
        return ResponseMsg.builder().code(200).msg("所有部落分类查询成功！").data(tribalCategory).build();
    }
}
